package com.lanou.sfu.songforu.view;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

/**
 * Created by quyan on 15/10/26.
 */
public class ReplaceFragment {
    public  ReplaceFragment(Fragment fragment,FragmentManager manager,int replaceID,boolean isAddToBackStack,String name){
        FragmentTransaction transaction = manager.beginTransaction();
        transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        transaction.replace(replaceID,fragment);
        if (isAddToBackStack){
            transaction.addToBackStack(name);
        }
        transaction.commit();
    }
}
